package com.example.controller;

import com.example.entity.demandMaintance.DemandMaintanceApply;
import com.example.service.DemandMaintanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 按需维保接口
 */
@RestController
@RequestMapping("api/demandMaintance/")
public class DemandMaintanceController {

    @Autowired
    DemandMaintanceService demandMaintanceService;

    @RequestMapping(value = "add", method = RequestMethod.POST)
    public Map<String,Object> add(@RequestBody DemandMaintanceApply demandMaintanceApply){
        Map<String,Object> result = demandMaintanceService.add(demandMaintanceApply);
        return result;
    }

    @RequestMapping(value = "query", method = RequestMethod.POST)
    public Map<String,Object> query(@RequestBody DemandMaintanceApply demandMaintanceApply){
        Map<String,Object> result = demandMaintanceService.query(demandMaintanceApply);
        return result;
    }

    @RequestMapping(value = "delete", method = RequestMethod.POST)
    public Map<String,Object> delete(@RequestBody Map map){
        Map<String,Object> result = demandMaintanceService.delete(map);
        return result;
    }

    @RequestMapping(value = "update", method = RequestMethod.POST)
    public Map<String,Object> update(@RequestBody Map map){
        return demandMaintanceService.update(map);
    }

    @RequestMapping(value = "export", method = RequestMethod.POST)
    public Map<String,Object> export(@RequestBody DemandMaintanceApply demandMaintanceApply){
        return demandMaintanceService.exportLetterOfCommitmentDoc(demandMaintanceApply);
    }
    
}
